/*
 * $Id: AboutAction.java 24 2009-03-31 23:40:10Z aaron.day $
 */
package org.crazydays.gameplan.swing;


import java.awt.Frame;
import java.awt.event.ActionEvent;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import org.crazydays.gameplan.GamePlan;

/**
 * AboutAction
 */
public class AboutAction
        extends AbstractActionWrapper
{
	/** serial version uid */
	public final static long serialVersionUID =
	        "$Id: AboutAction.java 24 2009-03-31 23:40:10Z aaron.day $"
	                .hashCode();

	/** log */
	protected static Log LOG = LogFactory.getLog(AboutAction.class);

	/** game plan */
	protected GamePlan gamePlan;

	/**
	 * AboutAction constructor.
	 * 
	 * @param gamePlan GamePlan
	 */
	public AboutAction(GamePlan gamePlan)
	{
		super("About", loadIcon("/com/famfamfam/silk/lightbulb.png"));
		setGamePlan(gamePlan);
	}

	/**
	 * Set game plan.
	 * 
	 * @param gamePlan Game plan
	 */
	public void setGamePlan(GamePlan gamePlan)
	{
		this.gamePlan = gamePlan;
	}

	/**
	 * Get game plan.
	 * 
	 * @return Game plan
	 */
	public GamePlan getGamePlan()
	{
		return gamePlan;
	}

	/**
	 * Open about dialog.
	 * 
	 * @param e Event
	 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
	 */
	public void actionPerformed(ActionEvent e)
	{
		JAboutDialog aboutDialog =
		        new JAboutDialog((Frame) getGamePlan().getParent());
		aboutDialog.setAlwaysOnTop(true);
		aboutDialog.setVisible(true);
	}

}
